package de.gwtprime.client.activities;

import java.util.List;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.web.bindery.requestfactory.shared.Receiver;

import de.gwtprime.client.ClientFactory;
import de.gwtprime.client.places.ArticleOverviewPlace;
import de.gwtprime.client.views.ArticleOverviewView;
import de.gwtprime.client.viewsStatic.NavigationViewImpl.Section;
import de.gwtprime.shared.requestFactory.OrderProxy;

public class ArticleAcitvityOverview extends PrimeAbstractActivity{
	
	private ClientFactory clientFactory;

	public ArticleAcitvityOverview(ArticleOverviewPlace place, ClientFactory clientFactory) {
		this.clientFactory = clientFactory;
	}
	@Override
	public void start(final AcceptsOneWidget panel, EventBus eventBus) {
		
		clientFactory.getNavigationView().activateSection(Section.ARTICLE);
		
		ArticleOverviewView articleOverview = clientFactory.getArticleOverviewWidget();
		panel.setWidget(articleOverview);
		clientFactory.getRequestFactory().orderRequest().loadOrders().fire(new Receiver<List<OrderProxy>>() {

			@Override
			public void onSuccess(List<OrderProxy> response) {
				
			}
		});
		
		
	}

}
